package com.isaiah.tree;

import com.sun.org.apache.regexp.internal.RE;

/**
 * @Title: 红黑树
 * @Description: ${todo}
 * @author: Haijun
 * @emial: isaiah@sohu.com
 * @date 2020/4/816:50
 */
public class RBTree<K extends Comparable<K>, V> {


    private static final boolean RED   = false;
    private static final boolean BLACK = true;

    /**
     *  定义树节点
     */
    public class Node {
        /**  颜色 */
        public boolean color;
        public K key;
        public V value;
        /** 左孩子 */
        public Node left;
        /** 右孩子 */
        Node right;

        public Node(K key, V value) {
            this.key = key;
            this.value = value;
            this.left = null;
            this.right = null;
            this.color = RED;           // 默认创建的节点为红色
        }
    }

    private Node root;

    private int size;

}
